#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>

char a[1000000] = { 0 }, b[1000000] = { 0 };
int main()
{
	int n = 0, m = 0, i = 0, j = 0, k = 0, count = 0, flag = 0;
	scanf("%d %s %d %s", &n, a, &m, b);
	for (i = 0; i < n; i++)
	{
		if (a[i] == b[0])
		{
			for (j = i, k = 0; k < m; k++, j++)
			{
				flag = 1;
				if (a[j] != b[k])
				{
					flag = 0;
					break;
				}
			}
			if (flag == 1)
				count++;
		}
	}
	printf("%d\n", count);

	return 0;
}